package com.cjl.designpattern.singleton.compare;

public class Lazy {
    private static volatile Lazy sInstance;

    private Lazy(){
        System.out.println("Lazy.Lazy");
    }

    public static Lazy getInstance(){
        if (sInstance == null){
            synchronized (Lazy.class){
                if (sInstance == null){
                    sInstance = new Lazy();
                }
            }
        }
        return sInstance;
    }
}
